//home模块专享的小仓库

import { reqCategory } from '@/api'
//仓库存储数据的地方
let state = {
    //商品分类的数据
    category: [],


};
//唯一可以修改仓库数据地方
let mutations = {

    GETCATEGORY(state, category) {
        state.category = category;
    }
};
let actions = {

    async getCategory({ commit, state, dispatch }) {

        let result = await reqCategory();

        if (result.code == 200) {

            commit("GETCATEGORY", result.data);
        }
    },
};

let getters = {};

export default {
    state,
    mutations,
    actions,
    getters
}




